#include <stdio.h>

#define LEN 80
char * char_index(char * str, char chr);

int main(int argc, char *argv[])
{

	char * ptr;

	ptr = char_index(argv[1], argv[2][0]);
	
	printf("argv[1] = %p", argv[1]);
	printf("\n");
	printf("ptr     = %p", ptr);
	
	return 0;
}


char * char_index(char * str, char chr)
{
	int i;
	
	i = 0;
	while ( *str != '\0')
	{
		
		if ( chr == *str)
			break;
		else
		{	
			str++;
			i++;
		}
	}
	
	if( chr == *str)
	{
		return str;
	}
	else
	{
		return NULL;
	}
}
